package pikes.ecma;

public class TernaryConditionalExpression extends PrintableExpression implements IConditionalExpression {

	private ILogicalORExpression condition = null;

	private IAssignmentExpression first = null;

	private IAssignmentExpression second = null;

	public TernaryConditionalExpression(ILogicalORExpression condition, IAssignmentExpression first,
			IAssignmentExpression second) {
		super();
		this.condition = condition;
		this.first = first;
		this.second = second;
	}

	public void visit(SyntaxTreeVisitor syntaxTreeVisitor) throws EcmaSyntaxVisitingException {
		condition.visit(syntaxTreeVisitor);
		syntaxTreeVisitor.questionMark();
		first.visit(syntaxTreeVisitor);
		syntaxTreeVisitor.colon();
		second.visit(syntaxTreeVisitor);
	}

}
